import { request } from 'ice';

export function tempSaveArt(value) {
  return request.post('/users/code/', value);
}

export function getInitArt(): Promise<{
  bgColor: string;
  clickedColor: Array<{ x: number; y: number; color: string }>;
}> {
  return request.get('/canvas/draw/');
}

export function saveTempArt(value: { bgColor: string; clickedColor: Array<{ x: number; y: number; color: string }> }) {
  return request.post('/canvas/draw/', value);
}

export function saveArt(value: { name: string; description: string }) {
  return request.post('/canvas/generatepic/', value);
}

export function cleanCanvas(value: { bgColor: string }) {
  return request.post('/canvas/clear/', value);
}
